<template>
  <div id="NavBar">
    <van-nav-bar :title="title" left-arrow @click-left="onClickLeft" />
  </div>
</template>

<script>
import { NavBar } from 'vant'
export default {
  name: 'c-nav-bar',
  // title：用来显示当前网页的title
  props: ['title'],
  components: {
    [NavBar.name]: NavBar
  },
  methods: {
    onClickLeft () {
      // 点击回退的时候当做地址回退
      this.$router.go(-1)
    }
  }
}
</script>

<style scoped>
  /*#NavBar {*/
    /*position: fixed;*/
    /*top: 0;*/
    /*left: 0;*/
    /*width: 100%;*/
    /*z-index: 100;*/
  /*}*/
</style>
